// DlgAddManyVT.cpp : implementation file
//

#include "stdafx.h"
#include "AccountManager.h"
#include "DlgAddManyVT.h"


// CDlgAddManyVT dialog

IMPLEMENT_DYNAMIC(CDlgAddManyVT, CDialog)

CDlgAddManyVT::CDlgAddManyVT(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgAddManyVT::IDD, pParent)
	, m_NVTAccountlist(_T(""))
{

}

CDlgAddManyVT::~CDlgAddManyVT()
{
}

void CDlgAddManyVT::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT_VTUSER_LIST, m_NVTAccountlist);
	DDX_Control(pDX, IDC_CHECK_ONLYACCESS, m_checkOnlyAccess);
}


BEGIN_MESSAGE_MAP(CDlgAddManyVT, CDialog)
	ON_BN_CLICKED(IDOK, &CDlgAddManyVT::OnBnClickedOk)
	ON_BN_CLICKED(IDC_CHECK_ONLYACCESS, &CDlgAddManyVT::OnBnClickedCheckOnlyaccess)
END_MESSAGE_MAP()


// CDlgAddManyVT message handlers

void CDlgAddManyVT::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	UpdateData();

	CString strTmp = m_NVTAccountlist;
	strTmp.Trim();

	if(-1 == strTmp.Find(','))
	{
		strTmp.Replace("\r\n", ",");
	}

	if(strTmp.Right(1) == ",")
	{
		strTmp = strTmp.Left(strTmp.GetLength() -1);
	}

	m_NVTAccountlist = strTmp;

	UpdateData(FALSE);

	OnOK();
}

void CDlgAddManyVT::OnBnClickedCheckOnlyaccess()
{
	// TODO: Add your control notification handler code here
	UpdateData();
	m_onlyAccess = m_checkOnlyAccess.GetCheck() ? true:false ;
}

BOOL CDlgAddManyVT::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	m_onlyAccess = false;
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
